package ru.nosport.matrixaria.modules.core.test;

import ru.nosport.matrixaria.modules.common.AppServerProcess;
import org.apache.commons.configuration.Configuration;

/**
 *
 * User: vfabr
 * Date: 12.10.2006
 * Time: 15:41:54
 * 
 */
public class StubCoreAppServProc implements AppServerProcess {
	private boolean isRunning;
	private Configuration conf;

	public StubCoreAppServProc(Configuration _conf) {
		this.conf = _conf;
	}

	public StubCoreAppServProc() {
		this.isRunning = false;
	}

	//public 

	public boolean moduleStart() {
		this.isRunning = true;
		return this.isRunning;  //To change body of implemented methods use File | Settings | File Templates.
	}

	//
	public boolean moduleStop() {
		this.isRunning = false;
		return !this.isRunning;  //To change body of implemented methods use File | Settings | File Templates.
	}

	//
	public boolean isModuleRunning() {
		return this.isRunning;  //To change body of implemented methods use File | Settings | File Templates.
	}

	//
	public String moduleStat() {
		return "Running: " + this.isRunning;  //To change body of implemented methods use File | Settings | File Templates.
	}

	//
	public String getParam() {
		return this.conf.getString("connection");
	}

	//
	public String getMyName() {
		return "I'am StubCoreAppServProc";
	}

	//
	public String standAct() {
		return "I'am standing";
	}

	public void getException() throws NullPointerException{
		throw new NullPointerException("TestException");
	}
}

